package user.controller;

import com.ganbo.user.api.api.UserClientApi;
import com.ganbo.user.api.model.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController implements UserClientApi {

    @Value("${server.port}")
    private String port;

    public User getUser(Long id, String username) {
        User user = new User();
        user.setId(id);
        user.setUsername(username);
        return user;
    }


    public User add(@RequestBody User user) {
        System.out.println("prot========>" + port + "user===================>" + user);
        return user;
    }

}
